package org.viva.core;

import java.io.IOException;
import java.util.Properties;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

/**
 * @author <a href="mailto:lichaohn@163.com">lichao</a>
 */
public class Config extends PropertyPlaceholderConfigurer {

    private static Properties config = null;

    @Override
    public void loadProperties(Properties props) throws IOException {
        super.loadProperties(props);
        props.putAll(System.getProperties());
        config = props;
    }

    public static Properties getConfig() {
        return config;
    }

    public static Object getConfig(String key) {
        return config.get(key);
    }

}
